<template lang="">
    <div>
        <div class="table-body-box">
            <div class="study-center-form">
                <el-form style="margin-left:60px;margin-top:25px;" :inline="true">
                    <el-form-item label="部门">
                        <el-select style="width:193px;" size="small" v-model="deptName" placeholder="选择部门">
                            <el-option label="全部" value=""></el-option>
                            <el-option v-for="item in getDeptNameList" :key="item" :label="item" :value="item"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="目前职级">
                        <el-select style="width:193px;" size="small" v-model="rankName" placeholder="选择职级">
                            <el-option label="全部" value=""></el-option>
                            <el-option v-for="item in getRankNameList" :key="item" :label="item" :value="item"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item style="margin-right:0;" label="审批状态">
                        <el-select style="width:193px;" size="small" v-model="status" placeholder="选择审批状态">
                            <el-option label="全部" value=""></el-option>
                            <el-option label="待审批" value="1"></el-option>
                            <el-option label="晋级成功" value="2"></el-option>
                            <el-option label="晋级失败" value="3"></el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
                <div class="btn-box">
                    <!-- <el-button type="primary" @click="searchList(1,10)" :loading="searchLoading" size="small">通过</el-button>
                    <el-button type="primary" @click="searchList(1,10)" :loading="searchLoading" size="small">驳回</el-button> -->
                    <el-button type="primary" @click="searchList(1,10)" :loading="searchLoading" size="small">查询</el-button>
                </div>
            </div>
            <div class="study-center-table">
                <el-table 
                row-class-name="greyRow"
                height="70vh"
                :data="tableData" 
                style="width: 100%" 
                @selection-change="handleSelectionChange"
                :header-cell-style="{background:'#4787E3',color:'#ffffff'}">
                <!-- <el-table-column
                    type="selection"
                    width="55">
                </el-table-column> -->
                  <el-table-column show-overflow-tooltip prop="username" label="姓名" align="center">
                  </el-table-column>
                  <el-table-column show-overflow-tooltip prop="deptName" label="部门" align="center">
                  </el-table-column>
                  <el-table-column show-overflow-tooltip prop="upperRankName" label="目前职级" align="center">
                  </el-table-column>
                  <el-table-column show-overflow-tooltip prop="nextRankName" label="晋级职级" align="center">
                  </el-table-column>
                  <el-table-column show-overflow-tooltip prop="status" :formatter="initData" label="审批状态" align="center">
                  </el-table-column>
                  <el-table-column
                  align="center"
                  fixed="right"
                  label="操作" 
                  width="140">
                  <template slot-scope="scope">
                      <el-button v-show="scope.row.status==1" style="text-decoration:underline;" type="text" @click="applyClick(scope.row,false)" size="small">审批</el-button>
                      <el-button v-show="scope.row.status==2 || scope.row.status==3" style="text-decoration:underline;" type="text" @click="applyClick(scope.row,true)" size="small">查看</el-button>
                      <el-button style="text-decoration:underline;" type="text" @click="deleteClick(scope.row,false)" size="small">删除</el-button>
                  </template>
                  </el-table-column>
                </el-table>
                <div class="study-center-pagination flex-row">
                  <pagination 
                    @pageTurnNum="pageNum" 
                    @pageTurnSize="pageSizeNum" 
                    :total="total"></pagination>
                </div>
            </div>
        </div>
        <el-dialog
        :title="infoTitle"
        :visible.sync="checkApply"
        width="800px"
        :before-close="handleClose">
        <div class="class-detail-box">
            <div class="tips-box">
                <div style="font-size:16px;" class="class-tips">晋级详情查看</div>
            </div>
            <div>
                <el-form 
                class="class-finish"
                style="text-align:center;"
                label-width='100px'
                :inline="true">
                    <el-form-item style="margin-bottom: 10px" label="姓名：">
                        <el-input
                        style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="getApprovalInfo.username">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="部门：">
                       <el-input
                       style="width:193px;"
                       readonly
                        clearable
                        size="small"
                        v-model="getApprovalInfo.deptName">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="岗位：">
                       <el-input
                       style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        placeholder="请输入内容"
                        v-model="getApprovalInfo.job">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="学历：">
                       <el-input
                       style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="getApprovalInfo.eduKind">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="目前职级：">
                       <el-input
                       style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="getApprovalInfo.upperRankName">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="晋级职级：">
                       <el-input
                        style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="getApprovalInfo.nextRankName">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="滞留年次：">
                       <el-input
                        style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="getApprovalInfo.detentionTime">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="入职时间：">
                       <el-input
                        style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="getApprovalInfo.hiredDate">
                        </el-input>
                    </el-form-item>
                </el-form>
            </div>
        </div>
        <div style="text-align:center;padding:36px 0 26px 0;">
          <span slot="footer"  class="dialog-footer">
              <el-button v-show='checkStatus' size="small" :loading="disagree"  @click="apply(0)">驳 回</el-button>
              <el-button v-show='checkStatus' size="small" :loading="agree" type="primary" @click="apply(1)">同 意</el-button>
              <el-button v-show='!checkStatus' size="small" :loading="agree" type="default" @click="checkApply = false">取 消</el-button>
          </span>
        </div>
        </el-dialog>
    </div>
</template>
<script src="./growth/growth"></script>
<style lang="less" scoped>
@import url("~@/pagecss/studyCenter");
@import url("~@/pagecss/classApply");
</style>